package com.ruoyi.exam.domain.entity;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 任务对象 t_task
 * 
 * @author ruoyi
 * @date 2024-12-19
 */
public class TTask extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 主键，任务ID */
    private Long id;

    /** 任务名称 */
    @Excel(name = "任务名称")
    private String name;

    /** 任务类型，基于字典表管理 */
    @Excel(name = "任务类型，基于字典表管理")
    private Integer type;

    /** 任务开始时间 */
//   时间改成年月日时分秒格式
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "任务开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    /** 任务结束时间 */
//    时间改成年月日时分秒格式
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "任务结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    /** 规定任务完成耗时，单位分钟 */
    @Excel(name = "规定任务完成耗时，单位分钟")
    private Long taskTime;

    /** 任务试卷ID，关联 t_task_exam_paper 表主键 */
    @Excel(name = "任务试卷ID，关联 t_task_exam_paper 表主键")
    private Long taskExamPaperId;

    private String questionConfig; // 每日一练的题目配置，json格式

    private Integer taskStatus; // 任务状态，0表示未开始，1表示已执行

    
    

    public Integer getTaskStatus() {
        return taskStatus;
    }

    public void setTaskStatus(Integer taskStatus) {
        this.taskStatus = taskStatus;
    }

    public String getQuestionConfig() {
        return questionConfig;
    }

    public void setQuestionConfig(String questionConfig) {
        this.questionConfig = questionConfig;
    }

    private TTaskExamPaper tTaskExamPaper;

    private Boolean expire; // 是否过期，查询条件使用，通过结束时间是否超过当前时间来判断，如果当前时间已经超过结束时间，则为过期任务

    public Boolean isExpire() {
        return expire;
    }

    public void setExpire(Boolean expire) {
        this.expire = expire;
    }

    public TTaskExamPaper gettTaskExamPaper() {
        return tTaskExamPaper;
    }

    public void settTaskExamPaper(TTaskExamPaper tTaskExamPaper) {
        this.tTaskExamPaper = tTaskExamPaper;
    }

    /** 是否删除，1表示已删除 */
    private Integer deleted;

    /** 排除的任务类型 */
    private String excludeType;

    public String getExcludeType() {
        return excludeType;
    }

    public void setExcludeType(String excludeType) {
        this.excludeType = excludeType;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getType() {
        return type;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setTaskTime(Long taskTime) {
        this.taskTime = taskTime;
    }

    public Long getTaskTime() {
        return taskTime;
    }

    public void setTaskExamPaperId(Long taskExamPaperId) {
        this.taskExamPaperId = taskExamPaperId;
    }

    public Long getTaskExamPaperId() {
        return taskExamPaperId;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public Integer getDeleted() {
        return deleted;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("name", getName())
                .append("type", getType())
                .append("startTime", getStartTime())
                .append("endTime", getEndTime())
                .append("taskTime", getTaskTime())
                .append("taskExamPaperId", getTaskExamPaperId())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("deleted", getDeleted())
                .toString();
    }
}
